<#include "../header.ftl">
<html>
<body>

<#include "../nav-top.ftl">
<input type="hidden" id="ids" value="${ids!""}"/>
<div class="sui-container" style="margin-top: 30px;">
    <ul class="sui-breadcrumb" style="padding: 0px 0px">
        <li><a href="#">消息管理</a></li>
        <li><a href="#">消息发布</a></li>
        <li class="active">新增</li>
    </ul>

    <div class="sui-row-fluid">

        <div class="span5">
            <form id="form-msg" class="sui-form form-horizontal" novalidate="novalidate">
                <div class="control-group">
                    <label for="msgSendedTitle">标　　题：</label>
                    <div class="controls">
                        <input type="text" class="input-xlarge" id="msgSendedTitle" name="msgSendedTitle"
                               placeholder="标题"
                               data-rules="required">
                    </div>
                </div>
                <div class="control-group">
                    <label for="msgType">消息类型：</label>
                    <div class="controls">
                        <select class="input-xlarge" id="msgType">
                        <#list messagesType as type>
                            <option value="${type.codeValue}">${type.codeName}</option>
                        </#list>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label for="sendType">发送类型：</label>
                    <div class="controls">
                        <select class="input-xlarge" id="sendType">
                            <option value="1">立即发送</option>
                            <option value="2">定时发送</option>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label for="beginTime">发送日期：</label>
                    <div class="controls">
                        <input class="input-xlarge" type="text" id="beginTime" name="beginTime"
                               data-date-start-date="${date}" value="${date}"
                               data-toggle="datepicker" data-date-timepicker="true">
                    </div>
                </div>
                <div class="control-group">
                    <label for="msgSendedContent">内　　容：</label>
                    <div class="controls">
                        <textarea rows="6" class="input-xlarge" id="msgSendedContent"
                                  name="msgSendedContent">${msgContent}</textarea>
                    </div>
                </div>
                <div class="control-group">
                    <button href="javascript:void(0);" type="submit"
                            class="sui-btn btn-xlarge btn-primary addSendedMsg">发布
                    </button>
                    &nbsp;&nbsp;
                    <a href="/messages" type="button" class="sui-btn btn-xlarge btn-info">返回</a>
                </div>
            </form>

        </div>
        <div class="span7">
            <ul class="sui-nav nav-tabs nav-xlarge nav-primary">
                <li class="active"><a href="#qudao" data-toggle="tab">渠道</a></li>
                <li><a href="#zhanghao" data-toggle="tab">账号</a></li>
                <li><a href="#qunzu" data-toggle="tab">群组</a></li>
            </ul>
            <div class="tab-content">
                <div id="qudao" class="tab-pane active" style="max-height: 400px;;overflow-y: auto">
                    <form id="form-channel" class="sui-form form-horizontal" novalidate="novalidate">
                        <div class="control-group">
                            <label for="channelName">渠道名称：</label>
                            <div class="controls">
                                <input type="text" id="channelName" name="channelName" placeholder="渠道名称"
                                       data-rules="required">
                            </div>
                            &nbsp;&nbsp;
                            <a href="javascript:void(0);" class="sui-btn btn-large query-channel">查询</a>&nbsp;
                            </div>
                    </form>
                    <table class="sui-table table-bordered rowover-table" id="tab-channel">
                        <thead>
                        <tr>
                            <th><input type="checkbox" class="check-all-channel"/></th>
                            <th>渠道ID</th>
                            <th>渠道名称</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                <#--<div class="sui-pagination pagination-large channel-pagination" style="float: right">-->
                <#--<ul>-->
                <#--<li class="prev disabled"><a href="#">«上一页</a></li>-->
                <#--<li class="next"><a href="#">下一页»</a></li>-->
                <#--</ul>-->
                <#--</div>-->
                </div>
                <div id="zhanghao" class="tab-pane" style="max-height: 400px;;overflow-y: auto">
                    <form id="form-user" class="sui-form form-horizontal" novalidate="novalidate">
                        <div class="control-group">
                            <label for="accountName">账号名称：</label>
                            <div class="controls">
                                <input type="text" id="accountName" name="accountName" placeholder="账号名称"
                                       data-rules="required">
                            </div>
                            &nbsp;&nbsp;
                            <a href="javascript:void(0);" class="sui-btn btn-large query-user">查询</a>
                            </div>
                    </form>
                    <table class="sui-table table-bordered rowover-table" id="tab-user">
                        <thead>
                        <tr>
                            <th><input type="checkbox" class="check-all-user"/></th>
                            <th>账号名称</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                <#--<div class="sui-pagination pagination-large user-pagination" style="float: right">-->
                <#--<ul>-->
                <#--<li class="prev disabled"><a href="#">«上一页</a></li>-->
                <#--<li class="next"><a href="#">下一页»</a></li>-->
                <#--</ul>-->
                <#--</div>-->
                </div>
                <div id="qunzu" class="tab-pane" style="max-height: 400px;;overflow-y: auto">
                    <form id="form-group" class="sui-form form-horizontal" novalidate="novalidate">
                        <div class="control-group">
                            <label for="groupName">群组名称：</label>
                            <div class="controls">
                                <input type="text" id="groupName" name="groupName" placeholder="群组名称"
                                       data-rules="required">
                            </div>
                            &nbsp;&nbsp;
                            <a href="javascript:void(0);" class="sui-btn btn-large query-group">查询</a>
                            </div>
                    </form>
                    <table class="sui-table table-bordered rowover-table" id="tab-group">
                        <thead>
                        <tr>
                            <th><input type="checkbox" class="check-all-group"/></th>
                            <th>群组名称</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>


                        </tbody>
                    </table>
                <#--<div class="sui-pagination pagination-large group-pagination" style="float: right">-->
                <#--<ul>-->
                <#--<li class="prev disabled"><a href="#">«上一页</a></li>-->
                <#--<li class="next"><a href="#">下一页»</a></li>-->
                <#--</ul>-->
                <#--</div>-->
                </div>
            </div>
        </div>
    </div>
</div>
<#include "../footer.ftl">
<script src="../../static/js/plugins/sea/sea.js"></script>
<script src="../../static/js/sea.config.js"></script>
<script>
    seajs.use('/static/js/game/messages/release.js');

</script>

<script id="tp-channel" type="text/html">
    <% for (var i = 0; i < list.length; i ++) {
    var channel = list[i];
    %>
    <tr>
        <td><input type="checkbox" name="channel-id" value=" <%= channel.channelId %>"
                   id="user-<%= channel.channelId %>"/></td>
        <td><%= channel.channelId %></td>
        <td><%= channel.channelName %></td>
        <td><%= channel.channelRemark %></td>
    </tr>
    <% } %>
</script>

<script id="tp-user" type="text/html">
    <% for (var i = 0; i < list.length; i ++) {
    var user = list[i];
    %>
    <tr>
        <td><input type="checkbox" name="user-id" value=" <%= user.uid %>" id="user-<%= user.uid %>"/></td>
        <td><%= user.accountName %></td>
        <td><%= user.uremark %></td>

    </tr>
    <% } %>
</script>

<script id="tp-group" type="text/html">
    <% for (var i = 0; i < list.length; i ++) {
    var group = list[i];
    %>
    <tr>
        <td><input type="checkbox" name="group-id" value=" <%= group.groupId %>" id="user-<%= group.groupId %>"/>
        </td>
        <td><%= group.groupName %></td>
        <td><%= group.groupRemark %></td>

    </tr>
    <% } %>
</script>
</body>
</html>
